/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.starcell.spring;

import org.cellstore.controlador.CellStoreController;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 *
 * @author PPATOCHE
 */
public class Spring {

    private ApplicationContext context;

    private Spring() {
        context = new ClassPathXmlApplicationContext("contexto/Spring.xml");
    }

    public CellStoreController getController() {
        CellStoreController bean = context.getBean(CellStoreController.class);
        return bean;
    }

    public static Spring getInstance() {
        return SpringHolder.INSTANCE;
    }

    private static class SpringHolder {

        private static final Spring INSTANCE = new Spring();
    }
}
